package Junit.domain;

import server.ForumServer;
import domain.items.ForumThread;
import domain.items.MetaData;
import domain.items.Post;
import domain.items.Topic;
import domain.users.Member;
import junit.framework.TestCase;

public class UsersTest extends TestCase {

	Member member;
	
	public UsersTest() {
		super("usersTest");
		try {
			setUp();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	protected void setUp() throws Exception {
		super.setUp();
		member = new Member("shai", "shai@wsep.com");
	}
	
	
	public void testSetNGetEmail() {
		assertEquals(member.getEmail(), "shai@wsep.com");
		member.setEmail("shai@forum.net");
		assertEquals(member.getEmail(), "shai@forum.net");
	}

	public void testGetUserName() {
		assertEquals(member.getUserName(), "shai");
	}

	public void testSetNGetSalt() {
		assertTrue(member.getSalt() >= 1 & member.getSalt() <= 10001);
		member.setSalt(50);
		assertEquals(member.getSalt(), 50);
	}

	public void testSetNGetRank() {
		assertEquals(member.getRank(), 1);
		member.setRank(2);
		assertEquals(member.getRank(), 2);
	}

}
